<template>
  <div class="about">
    <h1>This is an about page</h1>
    <Button  @click="getpage()">添加文章</Button>
  </div>
</template>
<script>
// 引入axios组件
import axios from "axios";
export default {
  data() {
    return {
    
    }
  },
  methods: {
    // 分页的钩子函数，当跳页的时候重新请求（将页码发给后台）
    getpage() {
      const self = this;
      axios({
        method: "post",
        url: "/admin/article/articleList",
        data: {

        }
      })
        .then(function(response) {
          console.log(response);
          self.$store.commit("getArticleList", response.data);
        })
        .catch(function() {
          console.log('请求失败');
        });
    }
  }
};
</script>